package com.yuyang.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author yu yang
 * @date 2023/1/19 -19:57
 */
@Data
public class UserRegistVo {
    @NotNull(message = "用户名必须填写")
    @Length(min = 6,max = 18,message = "用户名在6-18位之间")
    private String userName;
    @NotNull(message = "密码必须填写")
    @Length(min = 6,max = 18,message = "密码在6-18位之间")
    private String password;
    @NotNull(message = "手机号必须填写" )
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号格式错误")
    private String phone;
    @NotNull(message = "验证码必须填写")
    private String code;
}
